﻿package mortal.game.view.common.display
{
    import com.gengine.global.*;
    import com.mui.controls.*;
    import com.mui.display.*;
    import extend.language.*;
    import flash.display.*;
    import mortal.component.gconst.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.utils.*;
    import mortal.game.view.common.*;

    public class TextInputListRenderer extends GCellRenderer
    {
        private var _text:GTextFiled;
        private var _line:ScaleBitmap;

        public function TextInputListRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._text = UIFactory.gTextField("", 5, 0, 120, 20, this);
            this._line = UIFactory.bg(0, 20, 120, 1, this, ImagesConst.SplitLine);
            var _loc_1:* = ResourceConst.getScaleBitmap(ImagesConst.Menu_overSkin);
            this.setStyle("overSkin", _loc_1);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._text.dispose(param1);
            this._line.dispose(param1);
            this._text = null;
            this._line = null;
            super.disposeImpl(param1);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:ItemData = null;
            var _loc_3:String = null;
            super.data = param1;
            if (param1 != null)
            {
                _data = param1 as ItemInfo;
                if (Global.isDebugModle)
                {
                    _loc_2 = new ItemData((_data as ItemInfo).code);
                    _loc_3 = "";
                    if (ItemsUtil.isBind(_loc_2))
                    {
                        _loc_3 = Language.getString(20715);
                    }
                    if (ItemsUtil.isPrescriptionItem(_loc_2))
                    {
                        if (ItemsUtil.isPrescriOutTime(_loc_2))
                        {
                            _loc_3 = Language.getString(20716);
                        }
                        else
                        {
                            _loc_3 = Language.getString(20717);
                        }
                    }
                    this._text.htmlText = _loc_2.itemInfo.htmlName + _loc_3;
                }
                else
                {
                    this._text.htmlText = _data.htmlName;
                }
            }
            else
            {
                this._text.text = "";
            }
            return;
        }// end function

    }
}
